package com.crm.customers.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.crm.customers.dao.CustomerServiceDao;
import com.crm.customers.model.CusService;
import com.crm.customers.service.CusSerService;

@Service("cusSerService")
public class CusSerServiceImpl implements CusSerService {
	
	@Autowired
	private CustomerServiceDao customerServiceDao;

	@Override
	public CusService getCsByCusid(CusService cs) {
		return customerServiceDao.getCsByParams(cs);
	}

	@Override
	public int saveCusService(CusService cs) {
		int result = 0;
		//先判断id是否为空
		if (cs.getId() != null) {
			//修改
			result = customerServiceDao.update(cs);
		} else {
			//保存
			result = customerServiceDao.insert(cs);
		}
		return result;
	}

}
